fix(proxy): use local SPDK client for engine lookup in v2 VolumeGet#1430
Open
derekbit wants to merge 1 commit into
Open
fix(proxy): use local SPDK client for engine lookup in v2 VolumeGet#1430derekbit wants to merge 1 commit into
derekbit wants to merge 1 commit into
Conversation
Member
Author
|
Hello @davidcheng0922 Could you help review it? Thank you. |
Member
Author
|
@mergify backport v1.12.x |
🟠 Waiting for conditions to matchDetails
|
There was a problem hiding this comment.
Pull request overview
This PR fixes v2 proxy VolumeGet failures when the Engine and EngineFrontend are hosted on different Instance Managers (e.g., after fault recovery) by using the local SPDK service for engine lookup while using req.Address only for EngineFrontend lookup.
Changes:
- Updated v2
VolumeGetto always use the local SPDK service forEngineGet, independent ofreq.Address. - Added a separate SPDK client path for
EngineFrontendGetthat targetsreq.Address, with graceful fallback to engine-only info when the EF client cannot be created. - Extended
V2DataEngineProxyOpsto carryspdkServiceAddressfromNewProxy.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/proxy/volume.go | Splits v2 VolumeGet lookups into local engine vs. (possibly remote) EngineFrontend, with fallback behavior. |
| pkg/proxy/proxy.go | Adds spdkServiceAddress to V2DataEngineProxyOps and wires it from NewProxy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
53489e0 to
68bdbaa
Compare
The v2 proxy VolumeGet handler previously used req.Address (the DirectToURL of the service object) to create an SPDK client for both engine and EngineFrontend lookups. For v2 volumes, the manager passes the EngineFrontend's IM address as req.Address so the proxy can observe the frontend device state. When engine and EngineFrontend are on different Instance Managers (e.g. after fault recovery), this causes the handler to look up the engine on the EF's IM where it does not exist, resulting in a permanent NotFound error. Fix this by separating the two lookups: - Engine: always use the local SPDK service (the proxy runs on the engine's IM, so the engine is guaranteed to be local) - EngineFrontend: use req.Address to reach the potentially remote EF IM If the EF client connection fails, gracefully degrade to engine-only info rather than failing the entire call. Longhorn 13215 Signed-off-by: Derek Su <derek.su@suse.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
Issue longhorn/longhorn#13215
What this PR does / why we need it:
The v2 proxy VolumeGet handler previously used req.Address (the DirectToURL of the service object) to create an SPDK client for both engine and EngineFrontend lookups. For v2 volumes, the manager passes the EngineFrontend's IM address as req.Address so the proxy can observe the frontend device state.
When engine and EngineFrontend are on different Instance Managers (e.g. after fault recovery), this causes the handler to look up the engine on the EF's IM where it does not exist, resulting in a permanent NotFound error.
Fix this by separating the two lookups:
If the EF client connection fails, gracefully degrade to engine-only info rather than failing the entire call.
Special notes for your reviewer:
Additional documentation or context